-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhance] Enhance get_torchvision_models #1867
Merged
zhouzaida
merged 16 commits into
open-mmlab:master
from
HAOCHENYE:HAOCHENYE/compatible_with_torchvision_0.13
Apr 18, 2022
Merged
[Enhance] Enhance get_torchvision_models #1867
zhouzaida
merged 16 commits into
open-mmlab:master
from
HAOCHENYE:HAOCHENYE/compatible_with_torchvision_0.13
Apr 18, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zhouzaida
reviewed
Apr 13, 2022
zhouzaida
reviewed
Apr 15, 2022
zhouzaida
reviewed
Apr 15, 2022
zhouzaida
reviewed
Apr 15, 2022
zhouzaida
reviewed
Apr 15, 2022
zhouzaida
reviewed
Apr 15, 2022
zhouzaida
reviewed
Apr 17, 2022
zhouzaida
reviewed
Apr 17, 2022
zhouzaida
reviewed
Apr 17, 2022
ZwwWayne
reviewed
Apr 18, 2022
The PR message is not precise and clear. We should tell readers how to use old/new torchvision models through config. Please update the PR messages. |
zhouzaida
reviewed
Apr 18, 2022
zhouzaida
reviewed
Apr 18, 2022
zhouzaida
reviewed
Apr 18, 2022
zhouzaida
reviewed
Apr 18, 2022
zhouzaida
reviewed
Apr 18, 2022
zhouzaida
reviewed
Apr 18, 2022
zhouzaida
reviewed
Apr 18, 2022
zhouzaida
approved these changes
Apr 18, 2022
ZwwWayne
approved these changes
Apr 18, 2022
zhouzaida
approved these changes
Apr 18, 2022
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.
Motivation
Referred to #1848,
torchvision
after v0.13.0 removesmodel_urls
in all modules oftorchvision.model
and redesigned the way to get the model. This pr refactorget_torchvision_models
to make it compatible with torchvision 0.13.0 .Modification
mmcv/model_zoo/torchvision_0.12.json
, which will be additionally loaded intomodel_urls
ofget_torchvision_models
when torchvision version > 0.13.0.get_torchvision_models
will keep its original implementation. If torchvision version >= 0.13.0,get_torchvision_models
will get the newest URLs and the URLs of torchvision v0.12.0.BC-breaking (Optional)
No.
Use cases (Optional)
tochvision version < 0.13.0:
Specifiy pretrained model in config as before.
init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')
torchvision version >= 0.13.0:
Get newest resnet50 checkpoint by following style
init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50.imagenet1k_v1')
init_cfg=dict(type='Pretrained', checkpoint='torchvision://ResNet50_Weights.IMAGENET1K_V1')
(torchvision style)Get old checkpoint of torchvision v0.12.0
init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')
Checklist
Before PR:
After PR: